const fs = require('fs'); // 得到的fs是对象

const path = require('path'); //得到的path是对象 

const {readFile,writeFile} = require('fs');


/* 
  readFile:function(){}
  writeFile:function(){}
  ....
*/

console.log(111)

//读取文件是异步方法
fs.readFile('宋词.txt','utf-8',(err,data)=>{
  if(err) throw err;
  console.log(333)
})

//读取文件是异步方法
fs.readFile('唐诗.txt','utf-8',(err,data)=>{
  if(err) throw err;
  console.log(444)
})

console.log(222)
